package com.xntv.api;

import com.alibaba.fastjson.JSON;
import com.xntv.fast.pojo.Model;
import com.xntv.service.ModelService;
import com.xntv.util.ModelResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author fy
 * @version 1.0
 * @date 2020/12/23
 */

@RestController
@RequestMapping("/adapter/videoColumns")
public class ModelApi {

    @Resource
    private ModelService modelService;

    @RequestMapping("/listModels")
    public ModelResult getModels() {
        List<Model> models = modelService.getModels();
        return new ModelResult("success", "成功", (List<Model>) JSON.toJSON(models));
    }

}
